package com.example.userpointmgr.map;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.userpointmgr.dao.ReviewDto;
import com.example.userpointmgr.dao.UserPo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserMapper extends BaseMapper<UserPo> {
    //查询全部
    List<UserPo> findAllUsers(@Param("offset") int offset,@Param("pageSize") int pageSize);
    //查询总数 用于分页
    public int total();
    //新增用户
    public int userRegister(UserPo userPo);
    //删除用户 业务上不得用
    public int deleteUserByPhoneNumber(String phoneNumber);
    //根据手机号查找
    //使用selectOne自带方法
    UserPo selectOneByPhone(String phoneNumber);
    //查询工号重复
    UserPo selectOneByUserNum(Integer UserNum);
    //查询openid
    UserPo selectOneByOpenid(String openid);
    //更新用户 业务上不得用
//    public int updateUserByPhoneNumber(UserPo userPo);
//跟新积分和用户角色
    public int updateUserByopenid(UserPo userPo);
    public int updateUserByPhone(ReviewDto reviewDto);
    public UserPo selectOneByPhoneNumber(String phoneNumber);

}
